Skip to content

Add support for locking radio registers (1/n)#1771

Open
antoinevg wants to merge 1 commit into
mainfrom
antoinevg/register-lock
Open

Add support for locking radio registers (1/n)#1771
antoinevg wants to merge 1 commit into
mainfrom
antoinevg/register-lock

Conversation

@antoinevg

Copy link
Copy Markdown
Member

This PR adds support for locking radio registers.

Usage:

    # Lock the RADIO_FREQUENCY_RF register
    hackrf_debug --radio --register 1 --lock 1
    
    # Unlock the RADIO_FREQUENCY_RF register
    hackrf_debug --radio --register 1 --lock 0

Implementation decisions:

  • We don't have multi-field registers so locks are coarse-grained over the entire register.
  • Attempting to write to a locked register returns an error: RADIO_ERR_LOCKED_REGISTER
  • A lock prevents changing the register value rather than the application of a register value. This is to avoid a situation where registers are locked, other host software makes unanticipated changes and then there is a potentially unknown value in the register when it is unlocked.
  • Locks apply independent of the selected bank rather than per-bank. i.e. You can't have a register which is locked for RX but unlocked for APPLIED, ACTIVE, IDLE, TX and ALL.
  • Calling radio_init() clears all register locks.

@martinling

Copy link
Copy Markdown
Member

@miek and I were just discussing this but we don't really understand the use case yet - can you explain a bit?

@antoinevg
antoinevg force-pushed the antoinevg/register-lock branch from e88882b to 2d558d0 Compare June 5, 2026 14:33
@antoinevg antoinevg changed the title Add support for locking radio registers Add support for locking radio registers (1/n) Jun 9, 2026
@antoinevg
antoinevg force-pushed the antoinevg/register-lock branch from 2d558d0 to 3d47bbf Compare June 16, 2026 12:19
@antoinevg
antoinevg force-pushed the antoinevg/register-lock branch 2 times, most recently from f38bb53 to 9e6d265 Compare June 26, 2026 14:59
@antoinevg
antoinevg force-pushed the antoinevg/register-lock branch from 9e6d265 to 17c2782 Compare June 29, 2026 12:59
@antoinevg
antoinevg force-pushed the antoinevg/register-lock branch 2 times, most recently from 2efe10f to 47c5e92 Compare July 23, 2026 09:24
@antoinevg
antoinevg force-pushed the antoinevg/register-lock branch from 47c5e92 to a796889 Compare July 24, 2026 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants